import Input from "../../utils/Input";
import { FSMState } from "./lib/FSMState";

export default class PlayerIdleState extends FSMState {
    public update(dt: any): void {
        if (Input.getInstance().isKeyPressed(cc.macro.KEY.a) ||
            Input.getInstance().isKeyPressed(cc.macro.KEY.d) ||
            Input.getInstance().isKeyPressed(cc.macro.KEY.w) ||
            Input.getInstance().isKeyPressed(cc.macro.KEY.s) ||
            Input.getInstance().isKeyPressed(cc.macro.KEY.up) ||
            Input.getInstance().isKeyPressed(cc.macro.KEY.down) ||
            Input.getInstance().isKeyPressed(cc.macro.KEY.left) ||
            Input.getInstance().isKeyPressed(cc.macro.KEY.right)) {
            this.fsm.data.setData("isKeyPressed", true);
        }
    }
}
